package shop.services.front.activity.dao.impl;

import org.springframework.stereotype.Repository;
import shop.core.common.dao.BaseDao;
import shop.core.common.dao.page.PagerModel;
import shop.services.front.activity.bean.Activity;
import shop.services.front.activity.dao.ActivityDao;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by Administrator on 2017/4/21.
 */
@Repository("activityDaoFront")
public class ActivityDaoImpl implements ActivityDao {
    @Resource
    private BaseDao dao;
    public void setDao(BaseDao dao) {
        this.dao = dao;
    }


    @Override
    public int insert(Activity activity) {
        return dao.insert("front.activity.insert",activity);
    }

    @Override
    public int delete(Activity activity) {
        return 0;
    }

    @Override
    public int update(Activity activity) {
        return dao.update("front.activity.update", activity);
    }

    @Override
    public Activity selectOne(Activity activity) {
        return (Activity) dao.selectOne("front.activity.selectOne", activity);
    }

    @Override
    public PagerModel selectPageList(Activity activity) {
        return dao.selectPageList("front.activity.selectPageList",
                "front.activity.selectPageCount", activity);
    }

    @Override
    public List<Activity> selectList(Activity activity) {
        return dao.selectList("front.activity.selectList", activity);
    }

    @Override
    public int deleteById(int id) {
        return 0;
    }

    @Override
    public Activity selectById(String id) {
        return null;
    }

    @Override
    public List<Activity> selectActivityJoin(Activity activity) {
        return dao.selectList("front.activity.selectActivityJoin",activity);
    }

    @Override
    public int selectAmount(Activity activity) {
        return (int) dao.selectOne("front.activity.selectAmount",activity);
    }
}
